package com.yjy.fuyao.stu.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yjy.fuyao.stu.entity.Course;
import com.yjy.fuyao.stu.entity.form.CourseInfo;
import com.yjy.fuyao.stu.entity.form.CommentInfo;
import com.yjy.fuyao.stu.entity.query.CourseQuery;
import com.yjy.fuyao.stu.entity.vo.CourseQueryVo;
import com.yjy.fuyao.stu.entity.vo.CourseWebVo;
import com.yjy.fuyao.stu.entity.vo.PublishCourseVo;
import com.yjy.fuyao.stu.entity.vo.RateCourseVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author yjy
 * @since 2021-08-16
 */
public interface CourseService extends IService<Course> {

    String saveCourseInfo(CourseInfo courseInfo);

    CourseInfo getCourseInfoById(String id);

    PublishCourseVo getPublishCourseInfo(String id);

    boolean publishCourseById(String id);

    IPage<Course> listPage(Page<Course> pageParam, CourseQuery courseQuery);

    boolean removeCourseById(String id);

    List<Course> selectByTeacherId(String teacherId);

    Map<String, Object> pageListWeb(Page<Course> pageParam, CourseQueryVo courseQuery);

    Map<String, Object> pageCollectWeb(Long page,Long limit, String userId);


    /**
     * 获取课程信息
     * @param id
     * @return
     */
    CourseWebVo selectInfoWebById(String id);

    /**
     * 更新课程浏览数
     * @param id
     */
    void updatePageViewCount(String id);

    CourseInfo getCourseInfo(String courseId);

    boolean checkCourseById(String id, String checkResult);

    //增加课程评分
    void addCourseRate(Long score,String courseId);

    //为课程评分
    RateCourseVo rateForCourse(CommentInfo commentInfo);


    Integer countNewCourseByDay(String day);
}
